#!/usr/bin/node

const fs=require('fs'),
      http=require('http'),
      pic=process.argv[2];

let data=fs.readFileSync(pic);
data.toString('base64');

//log(`uri:${uri}`);

let html=`<html>
   <head>
      <title>data uri</title>
      <body><img src="data:[MIME-type][;charset=<encoding][;base64],<data>]" ></body>
   </head>
  </html>`;

http.createServer((req,res)=>{
  res.end(html);
}).listen(8080);
